Ext.define('Jason.view.example.grid.crud.MainView', {
    extend: 'Wys.basic.BaseView',
    xtype: 'crudGridView',
    requires: [
        'Jason.view.example.grid.basic.MainController',
        'Jason.view.example.grid.basic.MainModel',
        'Jason.store.example.grid.BasicGridStore'
    ],
    controller: 'basicGridViewCtrl',
    viewModel: { type: 'basicGridViewModel' },
    bind: '{standardGridStore}',
    selType: 'checkboxmodel',
    multiSelect: true,
    columns: [
        { xtype: 'rownumberer', text: '序号', align: 'center', width: 50 },
        { text: '字段1', dataIndex: 'field1', flex: 1 },
        { text: '字段1', dataIndex: 'field2', flex: 1 },
        {
            xtype: 'command',
            text: '操作',
            align: 'center',
            width: 106,
            commands: [
                { command: "preview", text: '<i class="fa fa-binoculars fa-lg"></i>', tooltip: { text: '预览' }, cls: 'radiusBtn command-info-color' },
                { command: "modify", text: "<i class='fa fa-edit fa-lg'></i>", tooltip: { text: '编辑' }, cls: 'radiusBtn command-modify-color' },
                { command: "remove", text: "<i class='fa fa-trash-o fa-lg'></i>", tooltip: { text: '删除' }, cls: 'radiusBtn command-remove-color' }
            ],
            listeners: {
                prepareCommands: 'onGridRepareCommands',
                command: 'onGridCommand'
            }
        }
    ],
    dockedItems: [{
        xtype: 'pagingtoolbar',
        bind: '{checkboxmodel}',
        dock: 'bottom'
    }, {
        xtype: 'toolbar',
        dock: 'top',
        items: [{
            xtype: 'gridsearchfield'
        }, {
            xtype: 'segmentedbutton',
            items: [{
                xtype: 'newbutton'
            }, {
                xtype: 'deletebutton'
            }]
        }, '->',/*'-',{xtype:'attachmentbutton'},*/{
            xtype: 'exportbutton',
            moduleInfo: {
                excelschemes: [{
                    title: '导出CRUD表格',
                    schemeid: '',
                    iconcls: ''
                }]
            }
        }]
    }]
});